+ def _rna_check(self, cr, uid, ids, context=None):
+ """Check if RNA code is well formatted"""
+ for partner in self.browse(cr, uid, ids, context=context):
+ if partner.rna:
+ if len(partner.rna) != 10:
+ return False
+ if partner.rna[0] != 'W':
+ return False
+ try:
+ int(partner.rna[1:10])
+ except ValueError:
+ return False
+ return True
+ else:
+ return True
+
+
+ def _siren_check(self, cr, uid, ids, context=None):
+ """Check if SIREN code is well formatted"""
+ for partner in self.browse(cr, uid, ids, context=context):
+ if partner.siren:
+ if len(partner.siren) != 9:
+ return False
+ try:
+ int(partner.siren)
+ except ValueError:
+ return False
+ return True
+ else:
+ return True
+
+